package com.yanqu.road.server.cmd.banquet.party;

import com.yanqu.road.pb.banquet.BanquetProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_BANQUET_MEMBER_LIST, desc = "请求宴会成员列表")
public class GetPartyMemberCmd extends AbstractCommand {

    private String banquetId;

    private int groupNum = 0;
    private int groupId = 0;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        BanquetProto.BanquetMemberInfoReq reqMsg = BanquetProto.BanquetMemberInfoReq.parseFrom(packet.getBytes());
        banquetId = reqMsg.getBanquetId();
        groupNum = reqMsg.getGroupNum();
        groupId = reqMsg.getGroupId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        BanquetProto.BanquetMemberInfoReq req = BanquetProto.BanquetMemberInfoReq.parseFrom(packet.getBytes());
        player.sendPacket(CrossProtocol.C_CROSS_PARTY_MEMBER_LIST, req.toBuilder());
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
